
public class LocalVarDecl {
	Type type ;
	String id;
	String sm;
	
	public LocalVarDecl(Type type, String id, String sm){
		this.type = type;
		this.id = id;
		this.sm = sm;
	}
	public String toString(){
		String ret = "LocalVarDecl "+ id +"" +
				"\n" ;
		return ret;
	}
	public void check() throws SemanticException {
		SymbolTable table = SymbolTable.getInstance();
		if (table.contains(id)) {
			throw new SemanticException("The identifier " + id + " has been used before");
		}	
		table.add(new Entry(id, type));
	}
}
